local pz = {
    ['R'] = 1,
    ['SR'] = 2,
    ['SSR'] = 3,
    ['UR'] = 4,
    ['UR+'] = 4,
}

class.card_data = extends(class.button) {
    reload = true,
    new = function (parent,x,y,w,h)
        local panel = class.card_data:builder 
        {
            parent = parent,
            x = x,
            y = y,
            w = w,
            h = h,
        }
        return panel
    end,

    init = function (self)
        class.button.init(self)
        self:set_normal_image([[textures\black32.blp]])
        self.highlight = self:add_panel([[UI\选中框.tga]],-20,-20,self.w+40,self.h+40)
        self.highlight:hide()
        self.jb = self:add_text('血牛(1/3)',0,10,nil,30,12,5)
        self.title = self:add_text('血牛',0,145,nil,30,12,5)
        self.icon = self:add_panel('1',(self.w-96)/2,45,96,96)
        self.art = self.icon:add_panel('',self.icon.w/2,self.icon.h/2,self.icon.w/2,self.icon.h/2)
        self.frame = self.icon:add_panel('')
        self.text = self:add_text('内容介绍内容介绍内容介绍内容介绍内容介绍内容介绍内容介绍',self.w*0.15,180,self.w*0.7,self.h-200,12)
        --自动换行
        self.text:set_width(self.text.w)
        return self
    end,
    set_data = function(self,skill)
        self.skill = skill
        self.frame:set_normal_image(skill.frame_art)
        self.icon:set_normal_image(skill.art)
        self.title:set_text(format_obj(skill,skill.title or skill.name))
        self.text:set_text(skill.card_tip or format_obj(skill,skill.tip))
        self.jb:set_text(format_obj(skill,skill.jb))
    end,
}

